'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	const table = event.table
	const db=uniCloud.database();
	let result=await db.collection(table).where({}).get();
	console.log(result)
	if(result.affectedDocs==0){
		return{
			code:500,
			msg:"没有数据"
		}
	}else{
		return{
			code:200,
			msg:"操作成功",
			data:result.data
		}
	}
	//返回数据给客户端
	return result
};
